﻿<%--<%@ Page Language="C#" AutoEventWireup="true"  EnableEventValidation="false" EnableViewState="true" CodeBehind="wfOrdenCompra.aspx.cs" Inherits="wfCompras.wfOrdenCompra" %>--%>
<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="../MasterPage.Master"
    CodeBehind="wfOrdenCompra.aspx.cs" Inherits="wfCompras.wfOrdenCompra" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %> 

<%--<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ Register src="ucControlFecha.ascx" tagname="ucControlFecha" tagprefix="uc1" %>
<%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajax" %> 

<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
    <title></title>
     <link href="../Styles/General.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/token-input-facebook.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/jquery-ui.custom.css" rel="stylesheet" type="text/css" />

    <script src="../Scripts/jquery.min.js" type="text/javascript"></script>
   
    <script src="../Scripts/jquery.tokeninput.js" type="text/javascript"></script>
    <script src="../Scripts/jquery-ui.min.js" type="text/javascript"></script>
    <script src="../Scripts/jquery.purr.js" type="text/javascript"></script>
    <script src="../Scripts/General.js" type="text/javascript"></script>
   
    <style type="text/css">
        .style1
        {
            width: 5px;
            height: 15px;
        }
        .style2
        {
            height: 15px;
        }
        .style4
        {
            width: 5px;
            height: 26px;
        }
        .style14
        {
            height: 15px;
            width: 147px;
        }
        .auto-style1
        {
            width: 5px;
            height: 20px;
        }
        .auto-style2
        {
            height: 20px;
        }
        .auto-style3
        {
            width: 30px;
            height: 20px;
        }
        .auto-style4
        {
            width: 110px;
            height: 20px;
        }
        </style>

    <script src="js/global.js" type="text/javascript"></script>
     
     <script type="text/javascript">



         function fDevolverSeleccion(codigo) {
             document.getElementById("<%= dpProv.ClientID %>").value = codigo
         }

         function fDevolverSeleccion2(codigo, Descrip) {
             document.getElementById("<%= txtCodPago.ClientID %>").value = codigo
             document.getElementById("<%= lblCodPago.ClientID %>").value = Descrip
         }

         function fDevolverSeleccion3(codigo, Descrip) {
             document.getElementById("<%= HiddPedidoPor.ClientID %>").value = codigo
             document.getElementById("<%= lblPedidoPor.ClientID %>").value = Descrip
         }

         function fDevolverSeleccion4(codigo, Descrip) {
             document.getElementById("<%= dpImportacion.ClientID %>").value = codigo

         }


         function ResizeGrid() {
             internalGridResize("<%= GVDetalleProducto.ClientID %>");
         }


         function panelOnUpdating() {
             updatePanelAnimationUpdating();
         }


         function panelOnUpdated() {
             ResizeGrid();
             updatePanelAnimationUpdated();
         }

         function fDevolverSeleccion5(codigo, pres, producto, presenta, um, peso_bruto) {
             document.getElementById("<%= hddCodigo.ClientID %>").value = codigo
             document.getElementById("<%= hddPres.ClientID %>").value = pres
             document.getElementById("<%= hddProducto.ClientID %>").value = producto
             document.getElementById("<%= hddPresenta.ClientID %>").value = presenta
             document.getElementById("<%= hddUm.ClientID %>").value = um
             document.getElementById("<%= hddPesoBruto.ClientID %>").value = peso_bruto
         }


         function fLoadNumbers(combo1) {
             DoCallBack("RefreshLoadNumbers", combo1.value, End_fLoadNumbers)
         }
         //---------------------------------------------------------//
         function End_fLoadNumbers(arg) {
             var mData = arg.split(":::");
             document.getElementById("tdValorProv").innerHTML = mData[0];
             //si utilizas jQuery sería así
             //$("#tdValores").html(mData[0]);
         }

    </script>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager>
       --%>

<asp:Content ID="Content1" ContentPlaceHolderID="head" runat="Server">
    <link href="../Styles/General.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/token-input-facebook.css" rel="stylesheet" type="text/css" />
    <link href="../Styles/jquery-ui.custom.css" rel="stylesheet" type="text/css" />

    <script src="../Scripts/jquery.min.js" type="text/javascript"></script>
   
    <script src="../Scripts/jquery.tokeninput.js" type="text/javascript"></script>
    <script src="../Scripts/jquery-ui.min.js" type="text/javascript"></script>
    <script src="../Scripts/jquery.purr.js" type="text/javascript"></script>
    <script src="../Scripts/General.js" type="text/javascript"></script>

    <script src="js/global.js" type="text/javascript"></script>
     
     <script type="text/javascript">

         function fDevolverSeleccion(codigo) {
             document.getElementById("<%= dpProv.ClientID %>").value = codigo
         }

         function fDevolverSeleccion2(codigo, Descrip) {
             document.getElementById("<%= txtCodPago.ClientID %>").value = codigo
             document.getElementById("<%= lblCodPago.ClientID %>").value = Descrip
         }

         function fDevolverSeleccion3(codigo, Descrip) {
             document.getElementById("<%= HiddPedidoPor.ClientID %>").value = codigo
             document.getElementById("<%= lblPedidoPor.ClientID %>").value = Descrip
         }

         function fDevolverSeleccion4(codigo, Descrip) {
             document.getElementById("<%= dpImportacion.ClientID %>").value = codigo

         }

         function ResizeGrid() {
             internalGridResize("<%= GVDetalleProducto.ClientID %>");
         }


         function panelOnUpdating() {
             updatePanelAnimationUpdating();
         }


         function panelOnUpdated() {
             ResizeGrid();
             updatePanelAnimationUpdated();
         }

         function fDevolverSeleccion5(codigo, pres, producto, presenta, um, peso_bruto) {
             document.getElementById("<%= hddCodigo.ClientID %>").value = codigo
             document.getElementById("<%= hddPres.ClientID %>").value = pres
             document.getElementById("<%= hddProducto.ClientID %>").value = producto
             document.getElementById("<%= hddPresenta.ClientID %>").value = presenta
             document.getElementById("<%= hddUm.ClientID %>").value = um
             document.getElementById("<%= hddPesoBruto.ClientID %>").value = peso_bruto
         }


         function fLoadNumbers(combo1) {
             DoCallBack("RefreshLoadNumbers", combo1.value, End_fLoadNumbers)
         }
         //---------------------------------------------------------//
         function End_fLoadNumbers(arg) {
             var mData = arg.split(":::");
             document.getElementById("tdValorProv").innerHTML = mData[0];
             //si utilizas jQuery sería así
             //$("#tdValores").html(mData[0]);
         }

    </script>
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="ContentPlaceHolder1" runat="Server">    

<input id="dummy" type="button" style="display: none" runat="server" />

<asp:UpdatePanel ID="udpInnerUpdatePanel" runat="Server" UpdateMode="Conditional">
    <ContentTemplate>
        <div class="ToolBar" style="height:24px">
            <asp:Menu ID="mnuToolbar" CssClass="ToolBarControl" runat="server" Orientation="Horizontal">
            </asp:Menu>
           <asp:ImageButton ID="btnGrabar" runat="server" style="width: 16px;height: 16px" ToolTip="Grabar" onclick="btnGrabar_Click"/>
           <asp:Label ID="Label19" runat="server" Font-Bold="True" ForeColor="Black" Text="Grabar"></asp:Label>
            &nbsp;&nbsp;&nbsp;
           <asp:ImageButton ID="btnSalir" runat="server" onclick="btnSalir_Click" style="width: 16px;height: 16px" ToolTip="Buscar" />
           <asp:Label ID="Label20" runat="server" Font-Bold="True" ForeColor="Black" Text="Salir"></asp:Label>
        </div>

        <div class="DataHeader">
            <table id="TableDataHeader" cellpadding="0" cellspacing="0">
                <tr>
                    <td colspan="3">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td style="width: 5px;">
                        &nbsp;
                    </td>
                    <td>
                        Datos Generales
                    </td>
                    <td style="width: 5px;">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td style="width: 5px;">
                        &nbsp;
                    </td>
                    <td>
                        <div style="border: 1px solid #ccc; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; -ms-border-radius: 5px;">
                            <table width="100%" cellpadding="0" cellspacing="2">
                                <tr>
                                    <td colspan="13">
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 5px;">
                                        &nbsp;
                                    </td>
                                    <td style="width: 110px;">
                                        Fecha O.C.:
                                    </td>
                                    <td colspan="10">
                                        <esd:esdDateTextBox ID="ucControlFecha1" runat="server" />
                                    </td>
                                    <td style="width: 5px;">
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td class="auto-style1">
                                        &nbsp;
                                    </td>
                                    <td class="auto-style2">
                                        Proveedor
                                    </td>
                                    <td colspan="2" class="auto-style2">
                                        <asp:DropDownList ID="dpProv" runat="server" CssClass="esdTextBox" Width="200px"> </asp:DropDownList>
                                        <asp:ImageButton ID="btnBuscarProv" runat="server" Height="16px" onclick="btnBuscarProv_Click" />
                                    </td>
                                    <td class="auto-style3">
                                        &nbsp;
                                    </td>
                                    <td class="auto-style4">
                                        Entrega en:
                                    </td>
                                    <td colspan="2" class="auto-style2">
                                        <asp:DropDownList ID="dpEntregaPor" runat="server" CssClass="esdTextBox" Width="200px"> </asp:DropDownList>
                                    </td>
                                    <td class="auto-style3">
                                        &nbsp;
                                    </td>
                                    <td class="auto-style2">
                                        Modalidad:
                                    </td>
                                    <td colspan="2" class="auto-style2">
                                        <asp:DropDownList ID="dpModalidad" runat="server" CssClass="esdTextBox" Width="200px"></asp:DropDownList>
                                    </td>
                                    <td class="auto-style1">
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 5px;">
                                        &nbsp;
                                    </td>
                                    <td>
                                        Tipo:
                                    </td>
                                    <td style="width: 70px;">
                                        <asp:DropDownList ID="dpTipo" runat="server" CssClass="esdTextBox" Width="200px"></asp:DropDownList>
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td style="width: 30px;">
                                        &nbsp;
                                    </td>
                                    <td>
                                        Importación:
                                    </td>
                                    <td colspan="2">
                                        <asp:DropDownList ID="dpImportacion" runat="server" CssClass="esdTextBox" Width="200px">
                                        </asp:DropDownList>
                                        <asp:ImageButton ID="btnBuscarImport" runat="server" onclick="btnBuscarImport_Click" />
                                    </td>
                                    <td style="width: 30px;">
                                        &nbsp;
                                    </td>
                                    <td>
                                        Moneda:
                                    </td>
                                    <td colspan="2">
                                        <asp:DropDownList ID="dpNoneda" runat="server" CssClass="esdTextBox" Width="100px"></asp:DropDownList>
                                    </td>
                                    <td style="width: 5px;">
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 5px;">
                                        &nbsp;
                                    </td>
                                    <td>
                                        Emitida por:
                                    </td>
                                    <td colspan="2">
                                        <asp:Label ID="lblEmitidoPor" runat="server" CssClass="esdTextBox"></asp:Label>
                                    </td>
                                    <td style="width: 30px;">
                                        &nbsp;
                                    </td>
                                    <td>
                                        Plazos de Credito:
                                    </td>
                                    <td colspan="2">

                                        <asp:TextBox ID="lblCodPago" runat="server" CssClass="esdTextBox"></asp:TextBox>
                                        <asp:ImageButton ID="btnBuscarCondPago" runat="server" onclick="btnBuscarCondPago_Click" style="width: 14px" />
                                    </td>
                                    <td style="width: 30px;">
                                        &nbsp;
                                    </td>
                                    <td>
                                        Prioridad:
                                    </td>
                                    <td colspan="2">
                                        <asp:DropDownList ID="dpPrioridad" runat="server" CssClass="esdTextBox" Width="200px"></asp:DropDownList>
                                    </td>
                                    <td style="width: 5px;">
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 5px;">
                                        &nbsp;
                                    </td>
                                    <td>
                                        Condicion Pago:
                                    </td>
                                    <td colspan="2">
                                        <asp:TextBox ID="txtCodPago" runat="server" CssClass="esdTextBox" Width="50px"></asp:TextBox>
                                    </td>
                                    <td style="width: 5px;">
                                        &nbsp;
                                    </td>
                                    <td>
                                        Tipo de cambio:</td>
                                    <td colspan="2">
                                        <asp:TextBox ID="txtTipCambio" runat="server" CssClass="esdTextBox" Width="50px"></asp:TextBox>
                                    </td>
                                    <td style="width: 5px;">
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="13">
                                        &nbsp;
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </td>
                    <td style="width: 5px;">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td style="width: 5px;">
                        &nbsp;
                    </td>
                    <td>
                        <div style="border: 1px solid #ccc; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; -ms-border-radius: 5px;">
                            <table width="100%" cellpadding="0" cellspacing="2">
                                <tr>
                                    <td colspan="13">
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 5px;">
                                        &nbsp;
                                    </td>
                                    <td style="width: 110px;">
                                        Fecha de entrega:
                                    </td>
                                    <td colspan="2">
                                        <esd:esdDateTextBox ID="ucControlFecha2" runat="server" />
                                    </td>
                                    <td style="width: 30px;">
                                        &nbsp;
                                    </td>
                                    <td style="width: 110px;">
                                        Centro de Costo
                                    </td>
                                    <td colspan="2">
                                        <asp:DropDownList ID="dpUsadoEn" runat="server" CssClass="esdTextBox" Width="200px"></asp:DropDownList>
                                    </td>
                                    <td style="width: 30px;">
                                        &nbsp;
                                    </td>
                                    <td>
                                        
                                    </td>
                                    <td colspan="2">
                                        &nbsp;
                                    </td>
                                    <td style="width: 5px;">
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 5px;">
                                        &nbsp;
                                    </td>
                                    <td>
                                        Observaciones
                                    </td>
                                    <td colspan="2">
                                        <asp:TextBox ID="txtObseracion" runat="server" CssClass="esdTextBox" Height="50px" Width="294px"></asp:TextBox>
                                    </td>
                                    <td style="width: 30px;">
                                        &nbsp;
                                    </td>
                                    <td>
                                        Pedido por:
                                    </td>
                                    <td colspan="2">
                                        <asp:TextBox ID="lblPedidoPor" runat="server" CssClass="esdTextBox"></asp:TextBox>
                                        <asp:ImageButton ID="btnBuscarPedido" runat="server" onclick="btnBuscarPedido_Click" Width="16px" />
                                    </td>
                                    <td style="width: 30px;">
                                        &nbsp;
                                    </td>
                                    <td>
                                        &nbsp;
                                    </td>
                                    <td colspan="2">
                                        &nbsp;
                                    </td>
                                    <td style="width: 5px;">
                                        &nbsp;
                                    </td>
                                </tr>
                                <tr>
                                    <td style="width: 5px;">
                                        &nbsp;
                                    </td>
                                    <td colspan="11">
                                        &nbsp;
                                    </td>
                                    <td style="width: 5px;">
                                        &nbsp; 
                                        <input id="HiddPedidoPor" runat="server" name="HiddPedidoPor" size="4" style="width: 56px; height: 0px" type="hidden" />
                                    </td>
                                </tr>
                                <tr>
                                    <td colspan="13">
                                        &nbsp;
                                    </td>
                                </tr>
                            </table>
                        </div>
                    </td>
                    <td style="width: 5px;">
                        &nbsp;
                    </td>
                </tr>
                <tr>
                    <td colspan="3">
                        &nbsp;
                    </td>
                </tr>
            </table>
        </div>
            
     </ContentTemplate>

</asp:UpdatePanel>
 
<asp:HiddenField ID="hdnidCliProv" runat="server" />
<div style="border: 1px solid #ccc; border-radius: 5px; -moz-border-radius: 5px; -webkit-border-radius: 5px; -ms-border-radius: 5px;">
    <div>
        <asp:Button ID="btnNuevo" runat="server" onclick="btnNuevo_Click"  CssClass="esdButtonStyle"  Text="Nuevo" />
        <div>
            <input id="hidId" runat="server" name="hidId" size="1" style="width: 32px; height: 22px" type="hidden" />
            <input id="hdProducto" runat="server" name="hdColor" size="1" style="width: 32px; height: 22px" type="hidden" />
        </div>
        <%--<div style="width: 1100px">--%>
        <div style="width: 100%">
            <%--<div style="overflow: auto; width: 1100px; height: 201px">--%>
            <div style="width: 100%; clear:both; overflow:auto; height:1%; display:inline-block">
            <%--<div style="width: 1100px; clear:both; overflow:auto; height:1%; display:inline-block">--%>
                <div class="DataDetail" aria-multiline="True" >
                    <asp:GridView ID="GVDetalleProducto" runat="server"  ScrollBars="Auto" ScrollWidth="100%" Width="100%" AutoGenerateColumns="False" ShowHeaderWhenEmpty="True" onrowcommand="GVDetalleProducto_RowCommand" onrowdatabound="GVDetalleProducto_RowDataBound" onrowdeleting="GVDetalleProducto_RowDeleting" AllowSorting="True" > 
                    <AlternatingRowStyle CssClass="esdGridAlternativeRowStyle" />
                        <Columns>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:ImageButton ID="grdBttCmdEdit" CommandName="CmdEdit" CommandArgument="<%# Container.DataItemIndex %>" runat="server" ImageUrl="../Images/Icons/Enabled/Edit.png" ToolTip="Filtrar Producto" />
                                </ItemTemplate>
                                <HeaderStyle Width="22px" />
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:ImageButton ID="grdBttCmdMost" CommandName="CmdMst" CommandArgument="<%# Container.DataItemIndex %>" runat="server" ImageUrl="../Images/Icons/Enabled/HISTAPRO.png" ToolTip="Mostrar el Registro" />
                                </ItemTemplate>
                                <HeaderStyle Width="22px" />
                                <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                            </asp:TemplateField>
                            <asp:TemplateField>
                                <ItemTemplate>
                                    <asp:CheckBox ID="chkBxSelect" runat="server" />
                                </ItemTemplate>
                                </asp:TemplateField>
                            <asp:TemplateField HeaderText="N°">
                                <ItemTemplate>
                                    <asp:TextBox ID="txtNumCorrelativo"  CssClass="esdTextBox"  runat="server"  Text='<%# DataBinder.Eval(Container, "DataItem._Nu_Correla") %>' Width="50px"></asp:TextBox>
                                </ItemTemplate>
                                <FooterStyle Font-Size="X-Small" />
                                <HeaderStyle Font-Size="X-Small" />
                                <ItemStyle Font-Size="X-Small" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="idProducto" Visible="False">
                                <ItemTemplate>
                                    <asp:TextBox ID="txtIdproducto" runat="server"  CssClass="esdTextBox"  Width="100px"  Text='<%# DataBinder.Eval(Container, "DataItem._Codigo") %>' Enabled="False"></asp:TextBox>
                                </ItemTemplate>
                                <FooterStyle Font-Size="X-Small" />
                                <HeaderStyle Font-Size="X-Small" />
                                <ItemStyle Font-Size="X-Small" />
                            </asp:TemplateField>
                            <asp:TemplateField HeaderText="Id pres" Visible="False">
                                <ItemTemplate>
                                    <asp:TextBox ID="txtIdPres" runat="server" CssClass="esdTextBox"  Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._Pres") %>' Enabled="False"></asp:TextBox>
                                </ItemTemplate>
                                <HeaderStyle Font-Size="X-Small" />
                                <FooterStyle Font-Size="X-Small" />
                            </asp:TemplateField>
                <asp:TemplateField HeaderText="Producto">
                    <ItemTemplate>
                        <asp:TextBox ID="txtDsProducto" runat="server" CssClass="esdTextBox"  
                            Width="200px"  Text='<%# DataBinder.Eval(Container, "DataItem._Producto") %>' 
                            Enabled="False"></asp:TextBox>
                    </ItemTemplate>
                    <HeaderStyle Font-Size="X-Small" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Presentacion">
                    <ItemTemplate>
                        <asp:TextBox ID="txtPresentacion" runat="server" CssClass="esdTextBox"  
                            Width="50px"  Text='<%# DataBinder.Eval(Container, "DataItem._Presenta") %>' 
                            Enabled="False"></asp:TextBox>
                    </ItemTemplate>
                    <FooterStyle Font-Size="X-Small" />
                    <HeaderStyle Font-Size="X-Small" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="U.M">
                    <ItemTemplate>
                        <asp:TextBox ID="txtUM" runat="server" CssClass="esdTextBox"  Width="50px"  
                            Text='<%# DataBinder.Eval(Container, "DataItem._UM") %>' Enabled="False"></asp:TextBox>
                    </ItemTemplate>
                    <FooterStyle Font-Size="X-Small" />
                    <HeaderStyle Font-Size="X-Small" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Peso Bruto" Visible="False">

                    <ItemTemplate>
                        <asp:TextBox ID="txtPesoBruto" runat="server" CssClass="esdTextBox"  
                            Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._Peso_Bruto") %>' 
                            Enabled="False"></asp:TextBox>
                    </ItemTemplate>
                    <FooterStyle Font-Size="X-Small" />
                    <HeaderStyle Font-Size="X-Small" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Lote">
                    <ItemTemplate>
                        <asp:TextBox ID="txtLote" runat="server" CssClass="esdTextBox" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._Lote") %>'></asp:TextBox>
                    </ItemTemplate>
                    <HeaderStyle Font-Size="X-Small" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Fec. Vencimiento" Visible="false">
                    <ItemTemplate>
                        <asp:TextBox ID="txtFecVencimiento" runat="server" CssClass="esdTextBox" 
                            Width="75px" Text='<%# DataBinder.Eval(Container, "DataItem._fe_venc") %>'></asp:TextBox>
                    </ItemTemplate>
                    <HeaderStyle Font-Size="X-Small" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Fec.Entrega" Visible="false">
                    <ItemTemplate>
                        <asp:TextBox ID="txtFecEngrega" runat="server" CssClass="esdTextBox" 
                            Width="75px" Text='<%# DataBinder.Eval(Container, "DataItem._fe_Entrega") %>'></asp:TextBox>
                    </ItemTemplate>
                    <HeaderStyle Font-Size="X-Small" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="O.P">
                    <ItemTemplate>
                        <asp:DropDownList ID="dpdOP" runat="server" Width="100px" >
                            <asp:ListItem Value="P000002">Bocanegra</asp:ListItem>
                            <asp:ListItem Value="P000003">Faucett</asp:ListItem>
                        </asp:DropDownList>
                    </ItemTemplate>
                    <HeaderStyle Font-Size="X-Small" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Cantidad">
                    <ItemTemplate>
                        <asp:TextBox ID="txtCantidad" runat="server" CssClass="esdTextBox" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._Cant") %>'></asp:TextBox>
                    </ItemTemplate>
                    <HeaderStyle Font-Size="X-Small" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="p.Neto">
                    <ItemTemplate>
                        <asp:TextBox ID="txtPneto" runat="server" CssClass="esdTextBox" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._PreNeto") %>'></asp:TextBox>
                    </ItemTemplate>
                    <FooterStyle Font-Size="X-Small" />
                    <HeaderStyle Font-Size="X-Small" />
                </asp:TemplateField>

                <asp:TemplateField HeaderText="P.U">
                    <ItemTemplate>
                        <asp:TextBox ID="txtPU" runat="server" CssClass="esdTextBox" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._PreUnit") %>'></asp:TextBox>
                    </ItemTemplate>
                    <ControlStyle Font-Size="X-Small" />
                    <HeaderStyle Font-Size="X-Small" />
                </asp:TemplateField>

                    <asp:TemplateField HeaderText="%Desc">
                             
                        <ItemTemplate>
                            <asp:TextBox ID="txtPorDesc"  CssClass="esdTextBox"  runat="server" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._nu_pordscto") %>'></asp:TextBox>
                        </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Afect.IGV">
                            <ItemTemplate>
                                <asp:CheckBox ID="chkBxIGV" runat="server"  />
                            </ItemTemplate>
                </asp:TemplateField>

                <asp:TemplateField HeaderText="T.G">
                    <ItemTemplate>
                        <asp:DropDownList ID="dpTG" runat="server" Width="150px">
                        </asp:DropDownList>
                    </ItemTemplate>
                    <ControlStyle Font-Size="X-Small" />
                    <FooterStyle Font-Size="X-Small" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Und.Negocio">
                    <ItemTemplate>
                        <asp:DropDownList ID="dpdUN" runat="server" Width="150px" AutoPostBack="True" 
                            onselectedindexchanged="dpdUN_SelectedIndexChanged">
                        </asp:DropDownList>
                    </ItemTemplate>
                    <HeaderStyle Font-Size="X-Small" />
                </asp:TemplateField>

                <asp:TemplateField HeaderText="C.C">
                    <ItemTemplate>
                        <asp:DropDownList ID="dpdCC" runat="server" Width="150px"  AutoPostBack="True" 
                            onselectedindexchanged="dpdCC_SelectedIndexChanged"  >
                        </asp:DropDownList>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="idCosto">
                    <ItemTemplate>
                        <asp:TextBox ID="txtIdccostos" CssClass="esdTextBox"  runat="server" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._idCosto") %>' ></asp:TextBox>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="dsCosto" Visible="False">
                    <ItemTemplate>
                        <asp:TextBox ID="txtdsCosto" CssClass="esdTextBox"  runat="server" Width="150px" Text='<%# DataBinder.Eval(Container, "DataItem._C_Costos") %>'></asp:TextBox>
                    </ItemTemplate>
                </asp:TemplateField>

                    <asp:TemplateField HeaderText="Gto.Import">
                    <ItemTemplate>
                        <asp:DropDownList ID="dpdGtoImport" runat="server" Width="150px">
                        </asp:DropDownList>
                    </ItemTemplate>
                </asp:TemplateField>

                    <asp:TemplateField>
                    <ItemTemplate>
                        <asp:ImageButton ID="grdBttCmdCalcular" CommandName="CmdCalc" CommandArgument="<%# Container.DataItemIndex %>"
                            runat="server" ImageUrl="../Images/Icons/Enabled/Calculator.png" 
                            ToolTip="Actualizar Totales"/>
                    </ItemTemplate>
                    <HeaderStyle Width="22px" />
                    <ItemStyle HorizontalAlign="Center" VerticalAlign="Middle" />
                </asp:TemplateField>

                <asp:TemplateField HeaderText="Dscto">
                    <ItemTemplate>
                        <asp:TextBox ID="txtDscto" runat="server" CssClass="esdTextBox" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._Dscto") %>'></asp:TextBox>
                    </ItemTemplate>
                    <FooterStyle Font-Size="X-Small" />
                    <HeaderStyle Font-Size="X-Small" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="IGV">
                    <ItemTemplate>
                        <asp:TextBox ID="txtIGV" runat="server" CssClass="esdTextBox" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._Igv") %>'></asp:TextBox>
                    </ItemTemplate>
                    <HeaderStyle Font-Size="X-Small" />
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Sub. Total">
                    <ItemTemplate>
                        <asp:TextBox ID="txtSubTotal" runat="server" CssClass="esdTextBox" Width="50px" Text='<%# DataBinder.Eval(Container, "DataItem._subTotal") %>'></asp:TextBox>
                    </ItemTemplate>
                    <HeaderStyle Font-Size="X-Small" />
                </asp:TemplateField>
                        
                <asp:TemplateField>
                        <ItemStyle HorizontalAlign="Center" Width="40px" CssClass="etiqueta"></ItemStyle>
                        <ItemTemplate>
                        <asp:ImageButton ID="btnEliminar" runat="server" ImageUrl="~/Images/Icons/Enabled/Delete.png"
                            CommandName="CmdDel" 
                            CommandArgument='<%# Container.DataItemIndex%>'>
                        </asp:ImageButton>
                    </ItemTemplate>
                    </asp:TemplateField>

            </Columns>
                        <HeaderStyle CssClass="esdGridHeaderStyle" />
                        <PagerStyle CssClass="gridPagerStyle" />
                        <RowStyle CssClass="esdGridRowStyle" />
                        <SelectedRowStyle CssClass="esdGridSelectedRowStyle" />
                        <EmptyDataTemplate>
                        <div id="gridempty">
                            <asp:Image ID="imgEmpty" runat="server" ImageUrl="../Images/Controls/Attention.png" />
                            &nbsp;No existen registros para esta solicitud.
                        </div>
                    </EmptyDataTemplate>
                </asp:GridView>
                </div>
            </div>
            <div align="right">
                <div>
                    <asp:Label ID="lblDsc" runat="server"  Text="Tot.Desc:"></asp:Label>
                    <asp:TextBox ID="txtDescuento" runat="server" CssClass="esdTextBox"></asp:TextBox>
                </div>
                <div>
                    <asp:Label ID="lblIgv" runat="server" Text="Tot.IGV:"></asp:Label>
                    <asp:TextBox ID="txtIgv_" runat="server" CssClass="esdTextBox"></asp:TextBox>
                </div>
                <div>
                    <asp:Label ID="lblTotal" runat="server" Text="Total:"></asp:Label>                              
                    <asp:TextBox ID="txtTotal_" runat="server" CssClass="esdTextBox"></asp:TextBox>
                </div>
            </div>
        </div>
    </div>
</div>
<div>
    <asp:Label ID="lblMensaje" runat="server" Text=""></asp:Label>
</div>

<input id="HddIdEmitidopor" type="hidden" runat ="server"/>
<input id="hddIdOC" type="hidden" runat ="server" />
<input id="hddCodigo" type="hidden" runat ="server" />
<input id="hddPres" type="hidden" runat ="server"/>
<input id="hddProducto" type="hidden" runat ="server"/>
<input id="hddPresenta" type="hidden" runat ="server"/>

<input id="hddUm" type="hidden" runat ="server"/>
<input id="hddPesoBruto" type="hidden" runat ="server"/>

<input id="hidVentana" runat="server" name="hidVentana" size="1" style="width: 32px; height: 22px" type="hidden" />
  
<asp:HiddenField ID="HiddenField1" runat="server" />
   
</asp:Content>